package root.electronclass.electronclass.currency

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import root.electronclass.electronclass.R
import root.electronclass.electronclass.other.DeviceCodeActivity

/**
 * 预加载页
 */
class LauncherActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_launcher)
        playGIF()
    }

    private fun playGIF() {
        lifecycleScope.launch {
            delay(5000)
            startActivity(Intent(this@LauncherActivity, DeviceCodeActivity::class.java))
            finish()
        }
    }

}